#include <assert.h>
#include "vertexinfo.h"

using namespace PBVP;

VertexInfo::VertexInfo()
{
	face_valence = 0;
	edge_valence = 0;
}

void VertexInfo::addFaceNeighbor(int n)
{
	int sz = tri_neighbors.size();

	for(int i = 0; i < sz; i++) {
		if(tri_neighbors[i] == n) return;
	}
	tri_neighbors.push_back(n);
	face_valence ++;
}

void VertexInfo::addVertNeighbor(int n)
{
	int sz = vrt_neighbors.size();
	for(int i = 0; i < sz; i++) {
		if(vrt_neighbors[i] == n) return;
	}
	vrt_neighbors.push_back(n);
	edge_valence ++;
}

int VertexInfo::getFaceNeighbor(int n) 
{
	assert(n < face_valence);
	return tri_neighbors[n];
}

int VertexInfo::getVertNeighbor(int n) 
{
	assert(n < edge_valence);
	return vrt_neighbors[n];
}